<!--页面包含商品明细列表  订单商品外协供应商明细列表  订单备注 订单附言-->
<div id="erpOrderDetail" v-cloak v-show="!showDetail">
    <!-- 操作 start -->
    <div class="panel-default" style="display: block;margin-bottom: 10px;" align="center">
        <!-- 审核 -->
        <div style="padding: 5px 0;" class="container">
            <div class="row">
                <div class="col-md-8 col-md-offset-4">
                    <el-button size="small" class="pull-left" style="width: 100px;" @click="reload">返回</el-button>
                </div>
            </div>
        </div>
    </div>
    <!-- 操作 end -->
    <!-- 订单信息 start -->
    <el-row>
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>订单编号：&nbsp;&nbsp;{{erpOrder.orderNo}}</span>
                <#if shiro.hasPermission("order:erporder:updatePrice")>
                <a class="btn btn-primary btn-sm"  v-show="erpOrder.orderSource==2" @click="updatePmtGoods" style="float: right"><i class="fa fa-pencil-square-o"></i>&nbsp;{{updateOrderPmtGoodsFlag?"保存":"修改"}}</a>
                </#if>
            </div>
            <div class="text item">
                <div class="row" style="line-height:30px;font-size: 12px;">
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-4 text-right">会员名 ：</div>
                            <div class="col-md-8">{{erpOrder.memberName}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">联系人 ：</div>
                            <div class="col-md-8">{{erpOrder.shipName}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">生产状态 ：</div>
                            <div class="col-md-8">{{erpOrder.productionStatus}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">项目名称 ：</div>
                            <div class="col-md-8">
                                <span v-show="!updateOrderPmtGoodsFlag"> {{erpOrder.projectName}}</span>
                                <span v-show="updateOrderPmtGoodsFlag"> <el-input v-model="erpOrder.projectName" size="mini" ></el-input></span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-4 text-right">发货状态 ：</div>
                            <div class="col-md-8">{{erpOrder.shipStatus}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">付款状态 ：</div>
                            <div class="col-md-8" >{{erpOrder.payStatus}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">付款方式 ：</div>
                            <div class="col-md-8">{{erpOrder.payment}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">订单附言 ：</div>
                            <div class="col-md-8">{{erpOrder.memo}}</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-4 text-right">商品总额 ：</div>
                            <div class="col-md-8">{{erpOrder.totalAmount}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">优惠金额 ：</div>
                            <div class="col-md-8">
                             <span v-show="!updateOrderPmtGoodsFlag"> {{erpOrder.pmtGoods}}</span>
                             <span v-show="updateOrderPmtGoodsFlag"> <el-input v-model="erpOrder.pmtGoods" size="mini" ></el-input></span>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">应付金额 ：</div>
                            <div class="col-md-8">{{erpOrder.payableAmount}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">已付金额 ：</div>
                            <div class="col-md-8">{{erpOrder.payed}}</div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-4 text-right">收货人 ：</div>
                            <div class="col-md-8">{{erpOrder.shipName}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">联系方式 ：</div>
                            <div class="col-md-8">{{erpOrder.shipMobile}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">收货地区 ：</div>
                            <div class="col-md-8">{{erpOrder.shipArea}}</div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">收货地址 ：</div>
                            <div class="col-md-8">{{erpOrder.shipAddr}}</div>
                        </div>
                    </div>
                </div>
            </div>
        </el-card>
    </el-row>
    <!-- 订单信息 end -->

    <!-- 商品明细列表 start -->
     <el-row>
          <el-card class="box-card">
              <div slot="header" class="clearfix">
                  <span>商品明细列表</span>
                  <#if shiro.hasPermission("order:erporder:updatePrice")>
                  <a class="btn btn-primary btn-sm" v-show="erpOrder.orderSource==2" @click="startUpdatePrice" style="float: right"><i class="fa fa-pencil-square-o"></i>&nbsp;{{updateItemPriceFlag?"保存":"修改"}}</a>
                 </#if>
              </div>

              <el-table
                      :data="orderItemDetailData"
                      border
                      max-height="250"
                      style="width: 100%"
                      >
                  <el-table-column
                          fixed="left"
                          label="操作"
                          width="250" align="center">
                      <template slot-scope="scope">
                          <el-button @click="oneKeyAllot(scope.row)" type="text" size="small" v-show="scope.row.addcartBuyType!='fast'&&isAllot!=1">一键分配</el-button>
                          <el-button type="text" size="small" v-show="scope.row.addcartBuyType=='print'&&isAllot!=1" @click="craftAllot(scope.row)">工序分配</el-button>
                          <el-button @click="suppFormShow(scope.row)" type="text" size="small" >添加外协</el-button>
                      </template>
                  </el-table-column>
                  <el-table-column type="expand">
                      <template slot-scope="props" v-if="props.row.productInfoParamList">
                          <el-table
                                  :data="props.row.productInfoParamList"
                                  style="width: 90%">
                              <el-table-column label="部件名称" prop="partsName" align="center"></el-table-column>
                              <el-table-column label="规格/尺寸/材质/工艺" width="700" prop="basicParamStr" align="center"></el-table-column>
                              <el-table-column label="尺寸">
                                  <template slot-scope="scope" align="center">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                        {{props.row.cutModelObj[scope.row.partsId].paperLength}}*
                                        {{props.row.cutModelObj[scope.row.partsId].paperWide}}
                                    </span>
                                  </template>
                              </el-table-column>
                              <el-table-column label="印数" align="center">
                                  <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                         {{props.row.cutModelObj[scope.row.partsId].printNums[0]}}
                                    </span>
                                  </template>
                              </el-table-column>
                              <el-table-column label="印张" align="center">
                                  <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                         {{props.row.cutModelObj[scope.row.partsId].printSheets[0]}}
                                    </span>
                                  </template>
                              </el-table-column>
                              <el-table-column label="单价" align="center">
                                  <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                        {{props.row.cutModelObj[scope.row.partsId].unitPrice}}
                                    </span>
                                  </template>
                              </el-table-column>
                              <el-table-column label="起步价" align="center">
                                  <template slot-scope="scope">
                                    <span v-if="props.row.cutModelObj[scope.row.partsId] !=null">
                                        {{props.row.cutModelObj[scope.row.partsId].startPrice}}
                                    </span>
                                  </template>
                              </el-table-column>
                              <el-table-column label="工艺" prop="craftParamStr" align="center"></el-table-column>
                          </el-table>
                      </template>
                </el-table-column>
                <el-table-column
                        prop="name"
                        label="产品名称" align="center">
                </el-table-column>

                <el-table-column
                        prop="showAddon"
                        label="规格/尺寸/材质/工艺"
                        width="500px" align="center">
                </el-table-column>

                  <el-table-column
                          prop="price"
                          label="单价" align="center">
                  </el-table-column>

                  <el-table-column  prop="copy" label="款式" align="center">
                  </el-table-column>
                  <el-table-column
                          prop="nums"
                          label="数量" align="center">
                    <!--  <template slot-scope="scope" >
                          <span v-show="!updateItemPriceFlag">{{scope.row.nums}}</span>
                          <span v-show="updateItemPriceFlag"><el-input v-model="scope.row.nums"  @change="changeItemNums(scope.row)"></el-input></span>
                      </template>-->
                  </el-table-column>
                <el-table-column
                        prop="amount"
                        label="总价" align="center">
                    <template slot-scope="scope" >
                        <span v-show="!updateItemPriceFlag">{{scope.row.amount}}</span>
                        <span v-show="updateItemPriceFlag"><el-input v-model="scope.row.amount"  @change="changeItemPrice(scope.row)"></el-input></span>
                    </template>
                </el-table-column>
                <el-table-column
                        prop="status"
                        label="分配情况"
                        :formatter="formatterStatus" align="center">
                </el-table-column>
            </el-table>
        </el-card>
    </el-row>
    <!-- 商品明细列表 end -->

    <!-- 商品分配列表 start -->
    <el-row>
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>商品分配列表</span>
            </div>
            <div class="text item">
                <el-table border stripe ref="multipleTable" :data="erpOrderProductionList"
                          tooltip-effect="dark" size="mini">
                    <el-table-column type="index" label="序号" align="center"></el-table-column>
                    <el-table-column prop="productionOrder" label="分配第三方单号" align="center"></el-table-column>
                    <el-table-column prop="erpItemId" label="商品ID" align="center"></el-table-column>
                    <el-table-column prop="erpItemName" label="商品名称" align="center"></el-table-column>
                    <el-table-column prop="attributeName" label="工艺" align="center"></el-table-column>
                    <el-table-column prop="producerName" label="供应商" align="center"></el-table-column>
                    <el-table-column prop="cost" label="分配价格" align="center"></el-table-column>
                    <el-table-column prop="allotType" label="分配类型" align="center"></el-table-column>
                    <el-table-column prop="isOwn" label="是否自做" align="center">
                        <template slot-scope="scope">
                            {{scope.row.isOwn == 1 ? '是' : '否'}}
                        </template>
                    </el-table-column>
                    <el-table-column prop="csRemark" label="生产备注" align="center"></el-table-column>
                    <el-table-column label="操作" align="center">
                        <template slot-scope="scope">
                            <el-button type="text" @click="delAllotItem(scope.row.productionId)" size="small">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </el-card>
    </el-row>
    <!-- 商品分配列表 end -->

    <!-- 发票信息 start -->
    <el-row>
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>发票信息</span>
            </div>
            <div class="text item">
                <el-table border stripe ref="orderTaxTable" :data="orderTax"
                          tooltip-effect="dark" size="mini">
                    <el-table-column prop="orderId" label="原始单号" align="center"></el-table-column>
                    <el-table-column prop="taxType" label="发票类型" :formatter="formatTaxType" align="center"></el-table-column>
                    <el-table-column prop="taxIdentification" label="纳税人识别号" align="center"></el-table-column>
                    <el-table-column prop="taxContent" label="发票内容" align="center"></el-table-column>
                    <el-table-column prop="taxAddr" label="发票抬头" align="center"></el-table-column>
                    <el-table-column prop="taxTel" label="注册电话" align="center"></el-table-column>
                    <el-table-column prop="taxCompany" label="开户银行" align="center"></el-table-column>
                    <el-table-column prop="taxNumber" label="银行账户" align="center"></el-table-column>
                </el-table>
            </div>
        </el-card>
    </el-row>
    <!-- 发票信息 end -->

    <!-- 订单备注列表 start -->
    <el-row>
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>订单备注</span>
            </div>
            <div class="text item">
                <el-table
                        max-height="300"
                        border
                        :header-cell-style="{'text-align':'center'}"
                        :cell-style="{'text-align':'center'}"
                        :data="orderRemarksData"
                        style="width: 100%"
                >
                    <el-table-column
                            prop="orRemarks"
                            label="备注内容"
                            >
                    </el-table-column>
                    <el-table-column
                            prop="orCreateName"
                            label="创建人" width="200">
                    </el-table-column>
                    <el-table-column
                            prop="orCreateTime"
                            label="创建时间">
                    </el-table-column>
                </el-table>
            </div>
        </el-card>
    </el-row>
    <!-- 订单备注列表 end -->

</div>
